package BehaviorModel.strategyModel.discountCalculation;

public class ClientDiscountStrageClient {

    public static void main(String[] args) {
        ShoppingCart shoppingCart = new ShoppingCart();

        double price = 100;
        shoppingCart.setDiscountStrategy(new NoDiscount());

        // 无折扣计算
        System.out.println("Total price after no discount"+shoppingCart.calculateDiscount(price));

        // 10% 折扣计算
        shoppingCart.setDiscountStrategy(new PercentageDiscount(10));
        System.out.println("total price after 10% discount"+shoppingCart.calculateDiscount(price));

        // 固定金额折扣计算
        shoppingCart.setDiscountStrategy(new FixedAmountDiscount(50));
        System.out.println("total price after 10 fixed amount discount"+shoppingCart.calculateDiscount(price));

    }
}
